﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BizzCommInterfaces
{
    public class BizzMessage
    {
        public string Title { get; set; }
        public List<MsgAttribute> Attributes { get; set; }

        public BizzCommInterfaces.AttType getMsgType(string strType)
        {
            BizzCommInterfaces.AttType retType = BizzCommInterfaces.AttType.text;
            switch (strType)
            {
                case "Texto":
                    retType = BizzCommInterfaces.AttType.text;
                    break;
                case "Numero":
                    retType = BizzCommInterfaces.AttType.number;
                    break;
                case "Booleano":
                    retType = BizzCommInterfaces.AttType.boolean;
                    break;
                case "Fecha":
                    retType = BizzCommInterfaces.AttType.date;
                    break;
                default:
                    retType = BizzCommInterfaces.AttType.text;
                    break;
            }
            return retType;
        }

        public string setMsgType(BizzCommInterfaces.AttType TypeToSet)
        {
            string retType = "Texto";
            switch (TypeToSet)
            {
                case BizzCommInterfaces.AttType.text:
                    retType = "Texto";
                    break;
                case BizzCommInterfaces.AttType.number:
                    retType = "Numero";
                    break;
                case BizzCommInterfaces.AttType.boolean:
                    retType = "Booleano";
                    break;
                case BizzCommInterfaces.AttType.date:
                    retType = "Fecha";
                    break;
                default:
                    retType = "Texto";
                    break;
            }
            return retType;
        }
    }
}
